package pers.lc.testDataGenerator.utils;

public class StringUtils {
    public static Boolean isEmpty(CharSequence s){
        return s==null || s.length()==0;
    }
    public static Boolean isNotEmpty(CharSequence s){
        return !(s==null || s.length()==0);
    }
    public static Boolean isNull(CharSequence s){
        return s==null;
    }
    public static Boolean isNotNull(CharSequence s){
        return !(s==null);
    }
    public static Boolean isBlank(CharSequence s){
        if (s==null){
            return true;
        }
        final int strLen = s.length();
        if (strLen == 0) {
            return true;
        }
        for (int i = 0; i < strLen; i++) {
            if (!Character.isWhitespace(s.charAt(i))) {
                return false;
            }
        }
        return true;
    }
    public static Boolean isNotBlank(CharSequence s){
        if (s==null){
            return false;
        }
        final int strLen = s.length();
        if (strLen == 0) {
            return false;
        }
        for (int i = 0; i < strLen; i++) {
            if (!Character.isWhitespace(s.charAt(i))) {
                return true;
            }
        }
        return false;
    }
}
